home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 18
/
CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso
/
CUCD
/
Magazine
/
WiredWorld
/
THOR_2.5_upgrade
/
rexx
/
examples
/
FindFile.br
< prev
next >
Wrap
Text File
|
1997-09-15
|
2KB
|
105 lines
/* $VER: FindFiles.br 1.0 (6.9.95)
*
* Arexx script to find files on a bbs.
*
* Script by: Eivind Nordseth, Ultima Thule Software.
*/
options results
parse arg argument
template = 'BBSNAME/A,REST/F'
if(argument = '' | argument = '?') then
do
say '$VER: FindFiles.br 3.3 (12.09.94)'
say 'Template: BBSNAME/A,FAREANAME/K,SEARCH/K,NAME/S,KEYWORD/S,NEWERTHAN/K/N'
exit
end
if ~show('p', 'BBSREAD') then do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
address "BBSREAD"
signal on ERROR
READARGS template ARGS CMDLINE argument
if(rc ~= 0) then
do
say BBSREAD.LASTERROR
exit
end
SEARCHBRFILE bbsname '"' || ARGS.BBSNAME || '"' stem SRESULT ARGS.REST
if(result > 0) then
do
do f=1 to SRESULT.FILEAREA.COUNT
say '0a'x || '(' || SRESULT.FILEAREA.f || ')'
do i=1 to SRESULT.FILE.f.COUNT
call showfiledata('"' || ARGS.BBSNAME || '"', '"'|| SRESULT.FILEAREA.f || '"', SRESULT.FILE.f.i)
end
end
end
else say 'No files found'
exit
/* Procedure to show the data about a file */
showfiledata: procedure
parse arg bbs,farea,filenr
FDF_DELETED = '00000001'x
drop FILE. /* Important */
READBRFILE bbs farea filenr tagsstem FILE datastem DATA
nextfile = result
if (bitand(DATA.FLAGS,FDF_DELETED) ~= FDF_DELETED) then
do
if(symbol("FILE.DATE") = "VAR") then fdate = FILE.DATE
else date = DATA.FILEDATE
AMIGA2DATE fdate CD
fdatestr = right(CD.YEAR, 2) || right('0'||CD.MONTH, 2) || right('0'||CD.MDAY, 2)
if(symbol("FILE.SIZE") = "VAR") then fsize = FILE.SIZE
else size = "Unkn"
if(symbol("FILE.DOWNLOADS") = "VAR") then fdnls = FILE.DOWNLOADS
else fdnls = "Unkn"
if(symbol("FILE.DESCRIPTION.COUNT") = "VAR") then descr = FILE.DESCRIPTION.1
else descr = "NONE"
say left(FILE.NAME,16) || " " || fdatestr || " " || right(fsize,7) || right(fdnls,4) || " " || descr
if(descr ~= "NONE") then
do
if(FILE.DESCRIPTION.COUNT > 1) then
do
do n=2 to FILE.DESCRIPTION.COUNT
say left("",33) || FILE.DESCRIPTION.n
end
end
end
end
else say 'File is deleted'
return nextfile
ERROR:
if(rc ~= 0) then
do
say 'Error' rc 'in line' SIGL ':' BBSREAD.LASTERROR
exit
end
exit